<?php

namespace app\admin\controller\manageData;

use app\admin\model\ManageData as ManageDataModel;
use app\common\controller\Backend;
use think\db\exception\DbException;

class Index extends Backend
{
    /**
     * @var ManageDataModel
     */
    protected $model = null;
    /**
     * 新增/编辑时，对前端发送的字段进行排除（忽略不入库）
     * @var string[]
     */
    protected $preExcludeFields = ['id', 'create_time', 'update_time'];
    /**
     * 快速搜索字段
     * @var string[]
     */
    protected $quickSearchField = ['source_code', 'order_number'];

    /**
     * 开启数据限制
     */
    protected $dataLimit = 'allAuthAndOthers';

    protected $dataLimitField = 'admin_id';

    /**
     * 查看请求返回的主表字段控制
     */
    protected $indexField = ['id', 'produce_time', 'expire_time', 'line', 'production_address',
                             'order_number', 'name', 'shop_name', 'status', 'purchase_time',
                             'source', 'create_time'];

    public function initialize()
    {
        parent::initialize();
        $this->model = new ManageDataModel();
    }
}